﻿using System.Configuration;

namespace OperationPlugins.Configurations
{
    public sealed class CompositionSection : ConfigurationSection
    {
        /// <summary>
        /// Use these composition assemblies.
        /// </summary>
        [ConfigurationProperty("assemblies", IsRequired = false)]
        public AssemblyCollection Assemblies
        {
            get { return this["assemblies"] as AssemblyCollection; }
        }

        /// <summary>
        /// Retrieves the CompositionSection configuration section.
        /// </summary>
        public static CompositionSection Instance
        {
            get
            {
                CompositionSection section = null;

                object read = ConfigurationManager.GetSection("operationPluginsCompositions");
                if (read != null)
                {
                    section = read as CompositionSection;
                }

                return section;
            }
        }
    }
}
